﻿ <%@ Import Namespace="System.Xml" %>

<script language="C#" runat="Server">
void Page_Load(object sender, EventArgs e) 
{
   string path = Server.MapPath("xml\\"+Request.QueryString["name"]+".xml");
   System.IO.FileInfo file = new System.IO.FileInfo(path);
   Response.Clear();
   Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(file.Name));
   Response.AddHeader("Content-Length", file.Length.ToString());
   Response.ContentType = "application/octet-stream";
   Response.WriteFile(file.FullName);
   Response.End();
}
</script> 